import Vue from 'vue'
import Vuex from 'vuex'
// import {getAdminInfo} from '@/api/getData'

Vue.use(Vuex)

const state = {
	adminInfo: {
		lp_addr: '',
		name: 'none',
		tuoguan_permission: 'no',
		web3_permission: 'no',
		

	},
}

const mutations = {
	saveAdminInfo(state, adminInfo) {
		state.adminInfo = adminInfo;
	},
	modifyname(state, name) {
		state.adminInfo.name = name;
	},
	modifypermission(state, permission) {
		state.adminInfo.permission = permission;
	}
}

const actions = {
	async getAdminData({
		commit
	}) {

		commit('saveAdminInfo', "kk");

		// try{
		// 	const res = await getAdminInfo()
		// 	if (res.status == 1) {
		// 		commit('saveAdminInfo', res.data);
		// 	}else{
		// 		throw new Error(res.type)
		// 	}
		// }catch(err){
		// 	// console.log(err.message)
		// }
	}
}

export default new Vuex.Store({
	state,
	actions,
	mutations,
})
